# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgbase=libsigc++
pkgname=('libsigc++' 'libsigc++-docs')
pkgver=2.10.0
pkgrel=1
arch=('i686' 'x86_64')
license=('LGPL')
url="http://libsigc.sourceforge.net/"
makedepends=('gcc-libs' 'git' 'mm-common' 'doxygen' 'libxslt' 'graphviz')
options=('!emptydirs')
_commit=83f1e2fe7855f85af570b9653903d2c426d67e72
source=("git://git.gnome.org/libsigcplusplus#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd libsigcplusplus
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd libsigcplusplus
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd libsigcplusplus
  ./configure --prefix=/usr
  make
}

package_libsigc++ () {
  pkgdesc="Libsigc++ implements a full callback system for use in widget libraries - V2"
  depends=('gcc-libs')
  provides=("libsigc++2.0=${pkgver}")
  replaces=('libsigc++2.0')
  conflicts=('libsigc++2.0')

  cd libsigcplusplus
  sed -i -e 's/^doc_subdirs/#doc_subdirs/' Makefile
  make DESTDIR="${pkgdir}" install
}

package_libsigc++-docs() {
  pkgdesc="Developer documentation for libsigc++"
  provides=("libsigc++2.0-docs=${pkgver}")
  replaces=('libsigc++2.0-docs')
  conflicts=('libsigc++2.0-docs')

  cd libsigcplusplus/docs
  make DESTDIR="${pkgdir}" install
}
